<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>
<body>
  <!-- 
React的style写法:
<p style={{fontSize: 20, 'background-color': 'pink'}}>style动态绑定</p>
   -->
  <div id="test">
      <p :style="{fontSize: size+'px', 'background-color': bgColor}">style动态绑定</p>
  </div>

  <script src="../js/vue.js"></script>
  <script>
    const vm = new Vue({
      el: '#test',
      data: {
        size: 15,
        bgColor: '#aaa'
      }
    })

    setTimeout(() => {
      vm.size = 30
      vm.bgColor = 'blue'
    }, 2000);
  </script>
</body>
</html>